
package com.trp.service;

import com.trp.model.CIMModel;
import com.trp.model.Substation;
import com.trp.model.asset.Pole;
import com.trp.model.psr.OverheadCircuit;
import com.trp.service.QueryModelType.Type;
import com.trp.view.PoleView;
import com.trp.view.SegmentView;

import java.util.HashMap;
import java.util.Map;

public class LoaderService extends ILoaderService.Stub {

    public Map<String, CIMModel> getRectModel(int x, int y, int x1, int y1) {
        return null;
    }

    public Map<String, CIMModel> getModel(QueryModelType type) {
        QueryModelType.Type t = type.getType();

        switch (t) {
            case KV500:
                return handleKV500();
        }

        return null;
    }


    private Map<String, CIMModel> handleKV500() {
        Map<String, CIMModel> m = new HashMap<String, CIMModel>();
        Substation s = new Substation();
        s.setX(92344D);
        s.setY(110000D);
        m.put("s", s);

        OverheadCircuit  oc = new OverheadCircuit();
        oc.setPoints(new float[]{92344F, 110000F,56784F,168435F});
        m.put("oc", oc);

        Pole p = new Pole();
        p.setX(56784D);
        p.setY(168435d);
        m.put("p", p);


        OverheadCircuit  oc1 = new OverheadCircuit();
        oc1.setPoints(new float[]{56784F, 168435F,62344F, 217463F});
        m.put("oc1", oc1);

     //   l.add(new SubstationView(this.getContext(), 62344D, 217463D));
        Substation s1 = new Substation();
        s1.setX(62344D);
        s1.setY(217463D);
        m.put("s1", s1);

        return m;
    }
}
